﻿@{
    ViewData["Title"] = "AddIngredient";
    Layout = "~/Views/Home/Main.cshtml";
}

<h1>原料管理/添加</h1>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    @*   <link rel="stylesheet" href="/layui.css"> *@ <!-- 确保layui的CSS路径正确 -->
    <style>
        .form-container {
            width: 80%;
            margin: 0 auto;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .layui-form-item {
            margin-bottom: 20px;
        }

            .layui-form-item .layui-inline {
                margin-right: 20px; /* 为每个内联元素添加右边距 */
            }

            .layui-form-item .layui-input-block {
                margin-left: 0; /* 移除单选按钮块的左边距 */
            }

            .layui-form-item:last-child {
                margin-bottom: 0; /* 移除最后一个表单项的底部边距 */
            }

        .layui-btn {
            margin-right: 10px; /* 为提交按钮添加右边距 */
        }
    </style>
</head>
<body>
    <div class="form-container">
        <form class="layui-form" action="">
            <div class="layui-form-item">
              <div class="layui-inline">
                    <label class="layui-form-label">原料编号</label>
                    <div class="layui-input-inline">
                        <input type="text" id="Ingredientnumber" name="ProcessPouteNumber" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">原料名称</label>
                    <div class="layui-input-inline">
                        <input type="text" id="IngredientName" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
  <div class="layui-form-item">
                    <label class="layui-form-label">原料分类：</label>
                    <div class="layui-input-inline" style="width: 200px;">
                    <select id="IngredientFen" required lay-verify="required" lay-search>
                        <option value="">请选择原料分类</option>
                        <option value="五金">五金</option>
                        <option value="电子材料">电子材料</option>
                        <option value="航空航天材料">航空航天材料</option>

                         </select>
                    </div>
                <label class="layui-form-label">尺寸：</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <select id="size" required lay-verify="required" lay-search>
                        <option value="">请选择尺寸</option>
                        <option value="8mm">8mm</option>
                        <option value="16mm">16mm</option>
                        <option value="10mm">10mm</option>
                        <option value="12mm">12mm</option>
                    </select>
                </div>
         </div>
            <div class="layui-form-item">
                <label class="layui-form-label">规格型号：</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <select id="specification" required lay-verify="required" lay-search>
                        <option value="">请选择规格型号：</option>
                        <option value="M8">M8</option>
                        <option value="M16">M16</option>
                        <option value="M10">M10</option>

                    </select>
                </div>
                <label class="layui-form-label">原料属性：</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <select id="Rawmaterialproperties" required lay-verify="required" lay-search>
                        <option value="">请选择原料属性</option>
                        <option value="采购">采购</option>
                        <option value="自制">自制</option>
                      
                    </select>
                </div>

            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">单位：</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <select id="unit" required lay-verify="required" lay-search>
                        <option value="">请选择单位：</option>
                        <option value="个">个</option>
                        <option value="箱">箱</option>
                        <option value="件">件</option>
                        <option value="套">套</option>
                    </select>
                </div>
                <label class="layui-form-label">库存数量：</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" id="Num" placeholder="" autocomplete="off" class="layui-input" min="0" step="1" lay-affix="number">
                </div>
     </div>

            <div class="layui-form-item">
                <label class="layui-form-label">原料类型：</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <select id="IngredientType" required lay-verify="required" lay-search>
                        <option value="">请选择原料类型：</option>
                        <option value="半成品">半成品</option>
                        <option value="成品">成品</option>
                        <option value="原料">原料</option>
                    </select>
                </div>
                <label class="layui-form-label">状态：</label>
                <div class="layui-input-inline">
                    <input type="radio" name="State" value="启用" title="启用" checked>
                    <input type="radio" name="State" value="禁用" title="禁用">
                </div>
                </div>


            <div class="layui-form-item">
                <label class="layui-form-label">原料数量：</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" id="IngredientNum" placeholder="" autocomplete="off" class="layui-input" min="0" step="1" lay-affix="number">
                </div>
                <label class="layui-form-label">报警天数：</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" id="alarmDays" placeholder="" autocomplete="off" class="layui-input" min="0" step="1" lay-affix="number">
                </div>
            </div>



            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">库存上限</label>
                    <div class="layui-input-inline">
                        <input type="text" id="InventoryLimit" name="ProcessPouteNumber" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">库存下限</label>
                    <div class="layui-input-inline">
                        <input type="text" id="InventoryMinimum" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">原料位置</label>
                    <div class="layui-input-inline">
                        <input type="text" id="Rawmateriallocation" name="ProcessPouteNumber" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">创建时间</label>
                    <div class="layui-input-inline">
                        <input type="text" id="CreatedTimess" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
     <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-inline">
                        <textarea id="remark" placeholder="请输入内容" class="layui-textarea"></textarea>
                    </div>
                </div>
          </div>
            <div class="layui-form-item">
                <button type="button" class="layui-btn" id="ID-upload-demo-btn">
                    <i class="layui-icon layui-icon-upload"></i> 单图片上传
                </button>
                <div style="width: 132px;">
                    <div class="layui-upload-list">
                        <img class="layui-upload-img" id="ID-upload-demo-img" style="width: 100%; height: 92px;">
                        <div id="ID-upload-demo-text"></div>
                    </div>
                    <div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-demo">
                        <div class="layui-progress-bar" lay-percent=""></div>
                    </div>
                </div>

            </div>
           
  <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="button" value="新增" class="layui-btn layui-bg-blue" onclick="DeviceAdd()" />
                    <button type="reset" class="layui-btn layui-btn-primary" onclick="location.href='/Ingredient/AddIngredient'">重置</button>
                </div>
            </div>
             </form>
        <!-- 在某个元素中嵌入 ApiUrl -->
        <div id="apiUrl" data-url="@Model.ApiUrl"></div>
  </div>
</body>
</html>
<script src="~/js/ingredient/addingredient.js"></script>

